<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>simple</title>
  </head>
  <body>
    <!-- flex   -->
    <!-- float position -->
    <!-- grid  擅长处理二维表格 -->
    <div class="grid">
      <div class="item item1">1</div>
      <div class="item item2">2</div>
      <div class="item item3">3</div>
      <div class="item item4">4</div>
      <div class="item">5</div>
      <!-- <div class="item">6</div>
      <div class="item">7</div>
      <div class="item">8</div> -->
    </div>
    <style>
      .grid {
        width: 600px;
        height: 400px;
        background-color: wheat;
        display: grid;
        /* step1: 确定列数和列宽 px fr auto */
        /* fr fraction 片段  */
        /* grid-template-columns: 1fr 1fr 1fr; */
        grid-template-columns: 1fr 1fr 1fr;
        /* grid-template-rows: 1fr 1fr 1fr; */
        /* step2 :思考
        填充确定的宽高 单元格内的排列  
        填充不确定的宽高
        */
        /* justify-items: center;
        align-items: center; */
        gap: 10px;
      }
      .item {
        border: solid 2px red;
        /* width: 100px;
        height: 100px; */
        background-color: blueviolet;
      }
      .item1 {
        height: 200px;
        background-color: cadetblue;
        grid-column-start: 1;
        grid-column-end: 4;
    
      }
      .item2 {
        grid-row-start:2 ;
        grid-row-end: 4;
        background-color: blue;
      }
      .item3 {
        background-color: chocolate;
        grid-row-start: 2;
        grid-row-end: 4;
        grid-column-start: 2;
        grid-column-end: 4;
      }
      .item4 {
        background-color: chartreuse;
      }
    </style>
  </body>
</html>
